#ifndef __NetService_H__
#define __NetService_H__

#include "INetService.h"
#include <list>

class NetService : public INetService
{
public:
    NetService();
    ~NetService();

    NetService(NFIPluginManager* p)
        : NetService()
    {
        pPluginManager = p;
    }

    virtual bool Init();
    virtual bool Shut();
    virtual bool ReadyExecute();
    virtual bool Execute();

    virtual bool AfterInit();
	
public:
	virtual NFINet* CreateClient(NET_RECEIVE_FUNCTOR handleRecieve, NET_EVENT_FUNCTOR handleEvent, const char* strIP, const unsigned short nPort);
	virtual NFINet* CreateServer(NET_RECEIVE_FUNCTOR handleRecieve, NET_EVENT_FUNCTOR handleEvent, const unsigned int nMaxClient, const unsigned short nPort, const int nCpuCount = 4);
    virtual NFIHttpNet* CreateHttpServer(HTTPNET_RECEIVE_FUNCTOR handleRecive, unsigned short nPort);

private:
    std::list<NFINet*> m_listNet;
    std::map<unsigned short, NFIHttpNet*> m_mapHttptNet;
};

#endif // __NetService_H__